package com.sram.service.impl;

import com.sram.dao.UserDao;
import com.sram.entity.User;
import com.sram.service.UserService;

public class UserServiceImpl implements UserService {
	private UserDao userDao;
	
	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	@Override
	public void deleteUser(int id) {
		userDao.deleteUser(id);
	}

	@Override
	public User login(String userName, String password) {
		return userDao.getUserByUserNameAndPassword(userName, password);
	}

	@Override
	public void saveUser(User user) {
		userDao.addUser(user);
	}

	@Override
	public void updateUser(User user) {
		userDao.updateUser(user);
	}

}
